<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>

<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/media/layui/css/layui.css" media="all">
<script src="${pageContext.request.contextPath}/media/js/jquery.min.js"></script>
</head>
<body>
	<div class="layui-container">
		<table class="layui-table" id="tbdata" lay-filter="tbop">
			<thead>
				<tr>
					<td>序号</td>
					<td>工号</td>
					<td>姓名</td>
					<td>部门</td>
					<td>性别</td>
					<td>邮箱</td>
					<td>QQ号</td>
					<td>手机号</td>
					<td>入职日期</td>
					<td>操作</td>
				</tr>
			</thead>
			<tbody>
			<c:forEach items="${pagebean.lis}" var="e" varStatus="v">
				<tr>
					<td>${e.id}</td>
					<td>${e.no}</td>
					<td>${e.name}</td>
					<td>${e.departname}</td>
					<td>${e.sex}</td>
					<td>${e.email}</td>
					<td>${e.phone}</td>
					<td>${e.qq}</td>
					<td>${e.createdate}</td>
					<td><a class="layui-btn layui-btn-mini" href="${pageContext.request.contextPath}/emp/update?eid=${e.id}">编辑</a>
						<a class="layui-btn layui-btn-danger layui-btn-mini"
						lay-event="del" onclick="deleteCourse(${e.id});">删除</a></td>
				</tr>
			</c:forEach>
			</tbody>
		</table>
		<div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-1" style="float: right;">
						  <a href="#" onclick="gopage(1);">首页</a>
				<c:if test="${pagebean.pagein!=1}">
				<a href="#" onclick="gopage(${pagebean.pagein-1});">上一页</a>
				</c:if>
				<c:forEach begin="${pagebean.start}" end="${pagebean.end}" step="1" var="i">
				<c:if test="${pagebean.pagein==i}">
				<a href="#" onclick="gopage(${i});" style="color: red;">${i}</a>
				</c:if>
				<c:if test="${pagebean.pagein!=i}">
				<a href="#" onclick="gopage(${i});">${i}</a>
				</c:if>
				</c:forEach>
				<c:if test="${pagebean.pagein!=pagebean.toalPage}">
				<a href="#" onclick="gopage(${pagebean.pagein+1});">下一页</a>
				</c:if>
				<a href="#" onclick="gopage(${pagebean.toalPage});">尾页</a>
				<span>
				[${pagebean.pagein}/${pagebean.toalPage}]页
				[${pagebean.count}]项
				</span>
							
						</div>
	</div>
	
	<script src="${pageContext.request.contextPath}/media/layui/layui.js"></script>
	
	<script type="text/javascript">
	   function deleteCourse(eid){
		   if(confirm("确定删除?")){
				　　location.href="${pageContext.request.contextPath}/emp/del?eid="+eid;
				}
	   }
	   function gopage(index) {
			location.href="${pageContext.request.contextPath}/emp/show?pageindex="+index;
		}
	</script>

</body>
</html>